import request from '@/router/axios';

export const insert = (data) => {
    return request({
        url: '/api/connector-api/connector/insert',
        method: 'post',
        data
    })
}

export const del = (data) => {
    return request({
        url: '/api/connector-api/connector/delete',
        method: 'post',
        params: data
    })
}
export const enable = (data) => {
    return request({
        url: '/api/connector-api/connector/enable',
        method: 'post',
        params: data
    })
}
export const disable = (data) => {
    return request({
        url: '/api/connector-api/connector/disable',
        method: 'post',
        params: data
    })
}

export const update = (data) => {
    return request({
        url: '/api/connector-api/connector/update',
        method: 'post',
        data
    })
}

export const getPage = (params) => {
    return request({
        url: '/api/connector-api/connector/page',
        method: 'get',
        params
    })
}
export const detail = (params) => {
    return request({
        url: '/api/connector-api/connector/detail',
        method: 'get',
        params
    })
}


export const generateApiUrl = (data) => {
    return request({
        url: '/api/connector-api/connector/generateApiUrl',
        method: 'post',
        data
    })
}
export const listAllOperationByTypeName = (data) => {
    return request({
        url: '/api/manager-api/mx-operation/listAllOperationByTypeName',
        method: 'post',
        params: data
    })
}
export const getAllOperationTreeByTypeName = (data) => {
    return request({
        url: '/api/manager-api/mx-operation/getAllOperationTreeByTypeName',
        method: 'post',
        params: data
    })
}

// 全局方法
export const getHandler = (params) => {
    return request({
        url: '/api/function-api/sysmethod/getHandlerByApplicationName',
        method: 'get',
        params
    })
}

// 根据全局方法编码查找参数名称
export const getParamNameByHandler = (params) => {
    return request({
        url: '/api/function-api/sysmethod/getParamNameByHandler',
        method: 'get',
        params
    })
}

// 关系列表
export const getReferenceList = (params) => {
    return request({
        url: '/api/manager-api/mx-reference/latestReleaseListIncludedBaseObject',
        method: 'get',
        params
    })
}